<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        //      let obj = {
        //     属性名1: 属性值1,
        //     属性名2: 属性值2
        // };
        let obj = {
            name: '张三',
            age: 18,
            height: 1.88,
            isMan: true,
            hobby: ['吃饭', '睡觉', '打豆豆'],
            friends: [
                {
                    name: '李四',
                    age: 20,
                    height: 1.88,
                    isMan: true,
                    hobby: ['吃饭', '睡觉', '打豆豆']
                },
                {
                    name: '王五',
                    age: 20,
                    height: 1.88,
                    isMan: true,
                    hobby: ['吃饭', '睡觉', '打豆豆']
                }
            ],
            show: function () {
                console.log('show方法')
            }
        }
        console.log(obj.name, obj.age, obj.height)
        console.log(obj['name'], obj['age'], obj['height'])
        obj.show()
        console.log(obj.friends[0].name, obj.friends[0].age)
        console.log(Object.values(obj)) // 获取对象属性值
        console.log(Object.keys(obj)) // 获取对象属性名
        console.log(Object.entries(obj)) // 获取对象属性名和属性值
        obj.address = '北京'
        console.log(obj)
    </script>
</head>
<body>

</body>
</html>
